package ae.pcfc.cldos.online.common.strategy.transfer.providers;

import ae.pcfc.cldos.online.common.clddb.domain.AppMetaData;
import ae.pcfc.cldos.online.common.clddb.domain.NocLetter;
import ae.pcfc.cldos.online.common.strategy.transfer.BaseTransferStrategy;
import ae.pcfc.cldos.online.common.vo.TransferDataVO;
import ae.pcfc.cldos.online.net.service.vo.AppMetaDataVO;
import ae.pcfc.cldos.online.net.service.vo.ApplicationDataVO;
import ae.pcfc.cldos.online.net.service.vo.NocLetterVO;


public class NocAndLettersTransferStrategyImpl extends BaseTransferStrategy {

	public String transferAppDateToOfflineSystem(TransferDataVO transferDataVO) {
		
		ApplicationDataVO applicationDataVO = new ApplicationDataVO();
		
		AppMetaData appMetaData = transferDataVO.getAppMetaData();
		
		AppMetaDataVO appMetaDataVO = new AppMetaDataVO();
		mapper.map(appMetaData, appMetaDataVO);
		
		NocLetter nocLetter = appMetaData.getNocLetter();
		NocLetterVO nocLetterVO = new NocLetterVO();  
		
		mapper.map(nocLetter, nocLetterVO);	
		applicationDataVO.setNocLetterVO(nocLetterVO);
		
		applicationDataVO.setAppMetaDataVO(appMetaDataVO);
		applicationDataVO.setNocLetterVO(nocLetterVO);

		return netDataTransferService.transferNocAndLettersData(applicationDataVO);
	}

}
